#include "HexapodRotate.h"

const float SIN45 = 0.7071;
const float COS45 = 0.7071;

void rotate0(const Point3D* src, Point3D* dest) {
	dest->x = src->x;
	dest->y = src->y;
	dest->z = src->z;
}

void rotate45(const Point3D* src, Point3D* dest) {
	dest->x = src->x * COS45 - src->y * SIN45;
	dest->y = src->x * SIN45 + src->y * COS45;
	dest->z = src->z;
}

void rotate135(const Point3D* src, Point3D* dest) {
	dest->x = src->x * (-COS45) - src->y * SIN45;
	dest->y = src->x * SIN45 + src->y * (-COS45);
	dest->z = src->z;
}

void rotate180(const Point3D* src, Point3D* dest) {
	dest->x = -src->x;
	dest->y = -src->y;
	dest->z = src->z;
}

void rotate225(const Point3D* src, Point3D* dest) {
	dest->x = src->x * (-COS45) - src->y * (-SIN45);
	dest->y = src->x * (-SIN45) + src->y * (-COS45);
	dest->z = src->z;
}

void rotate315(const Point3D* src, Point3D* dest) {
	dest->x = src->x * COS45 - src->y * (-SIN45);
	dest->y = src->x * (-SIN45) + src->y * COS45;
	dest->z = src->z;
}